<script>
export default {
    created() {
        // 调用API从本地缓存中获取数据
        /*
         * 平台 api 差异的处理方式:  api 方法统一挂载到 mpvue 名称空间, 平台判断通过 mpvuePlatform 特征字符串
         * 微信：mpvue === wx, mpvuePlatform === 'wx'
         * 头条：mpvue === tt, mpvuePlatform === 'tt'
         * 百度：mpvue === swan, mpvuePlatform === 'swan'
         * 支付宝(蚂蚁)：mpvue === my, mpvuePlatform === 'my'
         */

        let logs;
        if (mpvuePlatform === "my") {
            logs = mpvue.getStorageSync({
                key: "logs"
            }).data || [];
            logs.unshift(Date.now());
            mpvue.setStorageSync({
                key: "logs",
                data: logs
            });
        } else {
            logs = mpvue.getStorageSync("logs") || [];
            logs.unshift(Date.now());
            mpvue.setStorageSync("logs", logs);
        }
    },
    log() {
        console.log(`log at:${Date.now()}`);
    },
    onLaunch() {
        wx.getNetworkType({
            success: (res) => {
                if (res.networkType !== "none") return
                wx.navigateTo({
                  url:'/pages/nowifi1/main'
                })
            }
        })
    }
};
</script>

<style lang="scss">
@import "../static/weui/weui.css";

.container {
    font-family: "苹方";
}

.container__ {
    font-family: "苹方";
}

/* this rule will be remove */

* {
    transition: width 2s;
    -moz-transition: width 2s;
    -webkit-transition: width 2s;
    -o-transition: width 2s;
}

.weui-cell::before {
    border: none;
}

::-webkit-scrollbar {
    width: 0;
    height: 0;
    color: transparent;
}

.adrIcon {
    width: 10px;
    height: 12px;
    margin-right: 7px;
    vertical-align: middle;
}

.tags {
    line-height: 20px;
    background: rgba(234, 243, 255, 1);
    border: 1px solid rgba(26, 132, 251, 1);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #1a84fb;
    display: inline-block;
    padding: 0 10px;
    margin-top: 14px;
}

.classTit {
    padding: 5px 15px;
    position: relative;
    margin-top: 30rpx;

    .classBg {
        width: 72px;
        height: 27px;
        display: block;
    }

    .classWord {
        position: absolute;
        top: 5px;
        left: 15px;
        text-align: center;
        font-size: 14px;
        font-weight: 500;
        color: rgba(255, 255, 255, 1);
        padding-left: 3px;
    }
}

.line {
    width: 375px;
    height: 5px;
    background: rgba(244, 245, 245, 1);
}

.originator {
    .thumb {
        width: 45px;
        height: 45px;
        position: relative;
        border-radius: 50%;
        margin-right: 15px;

        .avatar {
            width: 45px;
            height: 45px;
            display: block;
        }

        span {
            display: block;
            font-size: 9px;
            text-align: center;
            font-weight: bold;
            color: rgba(233, 181, 94, 1);
            position: absolute;
            left: 0;
            right: 0;
            background: rgba(0, 0, 0, 1);
            opacity: 0.5;
            height: 15px;
            bottom: 0;
            border-radius: 0 0 50% 23px;
        }
    }

    .nickname {
        font-size: 14px;
        font-weight: 500;
        color: rgba(51, 51, 51, 1);
        line-height: 18px;
    }

    .time {
        font-size: 12px;
        font-weight: 500;
        color: rgba(102, 102, 102, 1);
        line-height: 18px;
    }
}

.txImg {
    direction: rtl;
    unicode-bidi: bidi-override;
    padding: 0 5px 0 10px;
    display: inline-block;

    .txItem {
        font-variant: small-caps;
        margin: 0;
        padding: 0;
        display: inline-flex;
        text-align: center;
        justify-content: center;
        align-items: center;
        white-space: nowrap;
        position: relative;
        background-size: cover;
        background-position: center;
        vertical-align: middle;
        width: 35px;
        height: 35px;
        margin-left: -10px;
        vertical-align: middle;

        img {
            width: 35px;
            height: 35px;
            border-radius: 50%;
            border: 1px solid #fff;
            display: block;
        }
    }
}

.remain {
    font-size: 14px;
    font-weight: 500;
    color: rgba(102, 102, 102, 1);
    line-height: 18px;

    span {
        color: #1a84fb;
    }
}

.report {
    width: 25px;
    height: 15px;
    display: block;
}

.shareIcon {
    width: 21px;
    height: 21px;
}
</style>
